# -*- coding: utf-8 -*-
import re

def getDataByRegex(str,reg):
    #FIXME 字符串转出正则表达式 '(\\d+)'   '(\d+)'
    print('str=',str)
    print('reg=',reg)
    reg = reg.replace("\\", '\\\\')
    pattern = re.compile(reg)
    r = re.search(pattern, str)
    return r.group()


if __name__ == '__main__':
    s='(\\d+)'
    captureThread= s.replace("\\", '\\\\')

    print(getDataByRegex('正在播放第1集', captureThread))
    pass